Skip to content

RDKEMW-15498:Implement software update service layer library (Fix review comments) - #219

Open
mkadinti wants to merge 481 commits into
developfrom
RDK-60527
Open

RDKEMW-15498:Implement software update service layer library (Fix review comments)#219
mkadinti wants to merge 481 commits into
developfrom
RDK-60527

Conversation

@mkadinti

Copy link
Copy Markdown
Contributor

No description provided.

…t-Driven Firmware Updates- UpdateFirmware API Implementation - L1 fixed for exiting tests
…-Driven Firmware Updates- UpdateFirmware API Implementation - Unit tests for XConf Fetching
…-Driven Firmware Updates- UpdateFirmware API Implementation - Unit tests for XConf Fetching
…-Driven Firmware Updates- UpdateFirmware API Implementation - reveritng .md files
…-Driven Firmware Updates- UpdateFirmware API Implementation - reverting README.md file removal
…-Driven Firmware Updates- UpdateFirmware API Implementation- partial L1 tests
…-Driven Firmware Updates- UpdateFirmware API Implementation- L1 for cache helper functions
…-Driven Firmware Updates- UpdateFirmware API Implementation- L1 xconf cache load functions
…-Driven Firmware Updates- UpdateFirmware API Implementation- L1 xconf cache load functions- DownlaodFirmware test cases
…-Driven Firmware Updates- UpdateFirmware API Implementation- L1 xconf cache load functions- DownlaodFirmware test cases
…-Driven Firmware Updates- UpdateFirmware API Implementation- L1 xconf cache load functions- DownlaodFirmware test cases
…-Driven Firmware Updates- UpdateFirmware API Implementation- L1 xconf cache load functions- UT compile fail debug
…-Driven Firmware Updates- UpdateFirmware API Implementation- L1 xconf cache load functions- UT compile fail debug - 2
…-Driven Firmware Updates- UpdateFirmware API Implementation- L1 xconf cache load functions- UT compile fail debug - 2
…-Driven Firmware Updates- UpdateFirmware API Implementation- L1 xconf cache load functions- UT compile fail debug - 3
…-Driven Firmware Updates- UpdateFirmware API Implementation- L1 xconf cache load functions- UT compile fail debug - 4
…-Driven Firmware Updates- UpdateFirmware API Implementation- L1 xconf cache load functions- UT compile fail debug - 5
…-Driven Firmware Updates- UpdateFirmware API Implementation- L2 for CheckForUpdate
…-Driven Firmware Updates- UpdateFirmware API Implementation- L2 for CheckForUpdate
…-Driven Firmware Updates- UpdateFirmware API Implementation- L2 for CheckForUpdate
…-Driven Firmware Updates- UpdateFirmware API Implementation- L1 clean up
…-Driven Firmware Updates- UpdateFirmware API Implementation- L1 clean up - compile fail fix
…-Driven Firmware Updates- UpdateFirmware API Implementation- L1 clean up - L2 for Basic register, unregister and CheckForUpdate
…-Driven Firmware Updates- UpdateFirmware API Implementation- L1 clean up - L1 - PR compile fix
…-Driven Firmware Updates- UpdateFirmware API Implementation- Seperated integration tests for Register
…-Driven Firmware Updates- UpdateFirmware API Implementation- Seperated integration tests for Register
…-Driven Firmware Updates- UpdateFirmware API Implementation- updated run_l2.sh
…-Driven Firmware Updates- UpdateFirmware API Implementation- Seperated Integration tests fot UnregisterProcess
…-Driven Firmware Updates- UpdateFirmware API Implementation- Seperated Integration tests fot UnregisterProcess
…-Driven Firmware Updates- UpdateFirmware API Implementation- Seperated Integration tests for CheckForUpdate
mkadinti and others added 25 commits March 9, 2026 15:04
…pl_plugin- revert if the changes are not wotking
…pl_plugin- revert if the changes are not working - 2
…pl_plugin- revert if the changes are not working - 3
…pl_plugin-copilot review for FirmwareInterfaceContext
…pl_plugin- example_plugin updateFirmware locOfFirmware fix
…pl_plugin- example_plugin updateFirmware locOfFirmware fix
…pl_plugin- example_plugin updateFirmware locOfFirmware fix
…ing exampl_plugin- example_plugin updateFirmware locOfFirmware fix"

This reverts commit 303ff72.
Copilot AI review requested due to automatic review settings March 17, 2026 07:30
@mkadinti
mkadinti requested a review from a team as a code owner March 17, 2026 07:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces/updates the librdkFwupdateMgr client-side service layer implementation (async CheckForUpdate redesign, plus logging/process registration), and adds new unit/stress test binaries, example app, and documentation to support/validate the new behavior.

Changes:

  • Added a new librdkFwupdateMgr client library implementation (process register/unregister via D-Bus, async engine, public API wrapper, and file-based logging).
  • Added multiple new gtest executables intended to stress/validate the async behavior (thread safety, signal parsing, cleanup, stress, refcount).
  • Updated autotools build files to build/install the library and the example_plugin, and to build the new unit test binaries; added docs/README content for the example app.

Reviewed changes

Copilot reviewed 6 out of 7 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
unittest/Makefile.am Adds new async gtest binaries and their build recipes.
unittest/rdkFwupdateMgr_async_threadsafety_gtest.cpp New concurrency/thread-safety tests for async APIs (currently references non-existent symbols).
unittest/rdkFwupdateMgr_async_stress_gtest.cpp New stress/benchmark tests (currently references non-existent symbols/types).
unittest/rdkFwupdateMgr_async_signal_gtest.cpp New signal parsing tests (currently references non-existent symbols).
unittest/rdkFwupdateMgr_async_refcount_gtest.cpp New refcount tests (currently references removed internal types/symbols).
unittest/rdkFwupdateMgr_async_cleanup_gtest.cpp New cleanup tests (currently references non-existent test hooks).
librdkFwupdateMgr/src/rdkFwupdateMgr_process.c Implements register/unregister process D-Bus APIs with validation and logging.
librdkFwupdateMgr/src/rdkFwupdateMgr_log.h / rdkFwupdateMgr_log.c Adds library logging infrastructure and macros.
librdkFwupdateMgr/src/rdkFwupdateMgr_async_internal.h Defines internal async architecture/types for on-demand worker + background thread.
librdkFwupdateMgr/src/rdkFwupdateMgr_async.c Implements on-demand checkForUpdate worker thread + download/update background thread and registries.
librdkFwupdateMgr/src/rdkFwupdateMgr_api.c Implements public APIs and library constructor/destructor wiring.
librdkFwupdateMgr/examples/example_app.c Provides a full “one-shot” workflow example; built as example_plugin.
librdkFwupdateMgr/examples/README.md / EXAMPLE_APP_README.md Adds documentation for building/running the example.
docs/CHECKFORUPDATE_PROGRESS.md Tracks redesign progress and next steps.
Makefile.am Enables building/installing librdkFwupdateMgr and example_plugin.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +346 to 365
pthread_mutex_lock(&g_check_in_progress_mutex);
CheckRequestContext *ctx = g_active_check_ctx;
pthread_mutex_unlock(&g_check_in_progress_mutex);

FWUPMGR_INFO("on_check_complete_signal: received\n");
if (ctx == NULL) {
FWUPMGR_INFO("internal_cancel_all_active_check_threads: no active worker\n");
return;
}

InternalSignalData signal_data;
memset(&signal_data, 0, sizeof(signal_data));
FWUPMGR_INFO("internal_cancel_all_active_check_threads: "
"stopping active worker thread\n");

if (!internal_parse_signal_data(parameters, &signal_data)) {
FWUPMGR_ERROR("on_check_complete_signal: parse failed\n");
return;
/* Quit the worker's event loop — this causes g_main_loop_run() to return */
if (ctx->main_loop != NULL) {
g_main_loop_quit(ctx->main_loop);
}

dispatch_all_pending(&signal_data);
/* Wait for worker thread to finish cleanup and exit */
pthread_join(ctx->thread, NULL);

Comment thread unittest/Makefile.am
Comment on lines 38 to 46
Comment on lines 25 to 33
Comment on lines 141 to 169
/*
* Spin-wait for background thread to set running=true.
* Max wait: 50 × 100ms = 5 seconds.
* Ensures D-Bus signal subscription is live before checkForUpdate()
* can send a D-Bus method call — prevents missing the response signal.
*/
for (int i = 0; i < 50; i++) {
pthread_mutex_lock(&g_bg_thread.mutex);
bool ready = g_bg_thread.running;
pthread_mutex_unlock(&g_bg_thread.mutex);
if (ready) break;

struct timespec ts = { .tv_sec = 0, .tv_nsec = 100 * 1000 * 1000 };
nanosleep(&ts, NULL);
}

/* Initialize download and update registries */
memset(&g_dwnl_registry, 0, sizeof(g_dwnl_registry));
if (pthread_mutex_init(&g_dwnl_registry.mutex, NULL) != 0) {
FWUPMGR_ERROR("internal_system_init: dwnl mutex init failed\n");
return -1;
}
g_dwnl_registry.initialized = true;

memset(&g_update_registry, 0, sizeof(g_update_registry));
if (pthread_mutex_init(&g_update_registry.mutex, NULL) != 0) {
FWUPMGR_ERROR("internal_system_init: update mutex init failed\n");
pthread_mutex_destroy(&g_dwnl_registry.mutex);
return -1;
Comment thread unittest/Makefile.am
Comment on lines 230 to 232
Comment thread unittest/Makefile.am
Comment on lines 248 to 250
Comment on lines 44 to 48
Comment on lines 24 to 31
Comment on lines 23 to 31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants